﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Acme.BookStore.Migrations
{
    /// <inheritdoc />
    public partial class CreateRuKuModel : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "ConnectFromModels",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "uuid", nullable: false),
                    FormNo = table.Column<string>(type: "text", nullable: true),
                    FormStaus = table.Column<int>(type: "integer", nullable: true),
                    StartTime = table.Column<DateTime>(type: "timestamp without time zone", nullable: true),
                    Provider = table.Column<string>(type: "text", nullable: true),
                    Department = table.Column<string>(type: "text", nullable: true),
                    StartName = table.Column<string>(type: "text", nullable: true),
                    GoodsNum = table.Column<int>(type: "integer", nullable: true),
                    GoodsPrice = table.Column<decimal>(type: "numeric", nullable: true),
                    ExtraProperties = table.Column<string>(type: "text", nullable: false),
                    ConcurrencyStamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false),
                    CreationTime = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
                    CreatorId = table.Column<Guid>(type: "uuid", nullable: true),
                    LastModificationTime = table.Column<DateTime>(type: "timestamp without time zone", nullable: true),
                    LastModifierId = table.Column<Guid>(type: "uuid", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_ConnectFromModels", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "ItemsModels",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "uuid", nullable: false),
                    RuKuDetailId = table.Column<Guid>(type: "uuid", nullable: false),
                    GoodsNo = table.Column<string>(type: "text", nullable: true),
                    GoodsName = table.Column<string>(type: "text", nullable: true),
                    GoodsSpec = table.Column<string>(type: "text", nullable: true),
                    Unit = table.Column<string>(type: "text", nullable: true),
                    CurrentNum = table.Column<int>(type: "integer", nullable: true),
                    PurchaseNum = table.Column<int>(type: "integer", nullable: true),
                    PurchaseJine = table.Column<decimal>(type: "numeric", nullable: true),
                    YiRuKu = table.Column<int>(type: "integer", nullable: true),
                    WeiRuKu = table.Column<int>(type: "integer", nullable: true),
                    RuKuType = table.Column<int>(type: "integer", nullable: false),
                    ExtraProperties = table.Column<string>(type: "text", nullable: false),
                    ConcurrencyStamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false),
                    CreationTime = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
                    CreatorId = table.Column<Guid>(type: "uuid", nullable: true),
                    LastModificationTime = table.Column<DateTime>(type: "timestamp without time zone", nullable: true),
                    LastModifierId = table.Column<Guid>(type: "uuid", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_ItemsModels", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "RuKuDetailModels",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "uuid", nullable: false),
                    RukuId = table.Column<Guid>(type: "uuid", nullable: false),
                    GoodsName = table.Column<string>(type: "text", nullable: true),
                    GoodsType = table.Column<string>(type: "text", nullable: true),
                    GoodsSpec = table.Column<string>(type: "text", nullable: true),
                    Unit = table.Column<string>(type: "text", nullable: true),
                    CurrentNum = table.Column<int>(type: "integer", nullable: true),
                    PurchaseNum = table.Column<int>(type: "integer", nullable: true),
                    YiRuNum = table.Column<int>(type: "integer", nullable: true),
                    WeiRuNum = table.Column<int>(type: "integer", nullable: true),
                    PurchasePrice = table.Column<decimal>(type: "numeric", nullable: true),
                    PurchaseJine = table.Column<decimal>(type: "numeric", nullable: true),
                    RuLocation = table.Column<int>(type: "integer", nullable: false),
                    BenRuNum = table.Column<int>(type: "integer", nullable: false),
                    PiCiNo = table.Column<string>(type: "text", nullable: true),
                    Createdate = table.Column<DateTime>(type: "timestamp without time zone", nullable: true),
                    Remarks = table.Column<string>(type: "text", nullable: true),
                    RuKuType = table.Column<int>(type: "integer", nullable: false),
                    ExtraProperties = table.Column<string>(type: "text", nullable: false),
                    ConcurrencyStamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false),
                    CreationTime = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
                    CreatorId = table.Column<Guid>(type: "uuid", nullable: true),
                    LastModificationTime = table.Column<DateTime>(type: "timestamp without time zone", nullable: true),
                    LastModifierId = table.Column<Guid>(type: "uuid", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_RuKuDetailModels", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "RukuModels",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "uuid", nullable: false),
                    RuKuNo = table.Column<string>(type: "text", nullable: false),
                    RuKuType = table.Column<int>(type: "integer", nullable: false),
                    RuKuStatus = table.Column<int>(type: "integer", nullable: true),
                    RuKuDate = table.Column<DateTime>(type: "timestamp without time zone", nullable: true),
                    StorehouseName = table.Column<int>(type: "integer", nullable: false),
                    ConnectNo = table.Column<string>(type: "text", nullable: true),
                    ItemName = table.Column<string>(type: "text", nullable: true),
                    AttnName = table.Column<string>(type: "text", nullable: true),
                    RuKuNum = table.Column<int>(type: "integer", nullable: true),
                    RuKuPrice = table.Column<decimal>(type: "numeric", nullable: true),
                    DepartName = table.Column<string>(type: "text", nullable: true),
                    ShenName = table.Column<string>(type: "text", nullable: true),
                    ShenDate = table.Column<DateTime>(type: "timestamp without time zone", nullable: true),
                    Provider = table.Column<string>(type: "text", nullable: true),
                    PhoneName = table.Column<string>(type: "text", nullable: true),
                    PhoneNum = table.Column<string>(type: "text", nullable: true),
                    Remark = table.Column<string>(type: "text", nullable: true),
                    Picture = table.Column<string>(type: "text", nullable: true),
                    ExtraProperties = table.Column<string>(type: "text", nullable: false),
                    ConcurrencyStamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false),
                    CreationTime = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
                    CreatorId = table.Column<Guid>(type: "uuid", nullable: true),
                    LastModificationTime = table.Column<DateTime>(type: "timestamp without time zone", nullable: true),
                    LastModifierId = table.Column<Guid>(type: "uuid", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_RukuModels", x => x.Id);
                });
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "ConnectFromModels");

            migrationBuilder.DropTable(
                name: "ItemsModels");

            migrationBuilder.DropTable(
                name: "RuKuDetailModels");

            migrationBuilder.DropTable(
                name: "RukuModels");
        }
    }
}
